import {defineStore} from 'pinia'

export const useUserStore = defineStore('userInfo', {
    state: () => ({
        userInfoData: {}
    }),
    actions: {
        initUserInfo(data) {
            this.userInfoData = data
        },
        getUserInfo() {
            return this.userInfoData;
        },
        clear() {
            this.$reset();
        }
    },
    persist: {
        enabled: true // true 表示开启持久化保存
    }
})